package com.example.nacosconfig.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wangjinlong
 * @date 2022/1/26 10:13
 */
@RefreshScope
@RequestMapping("/myrest")
@RestController
public class ConfigController {

    @Value("${nacos.config:1}")
    private Integer config;

    @GetMapping("get")
    public String getMsg(){
        return "hello nacos config " + config;
    }

}
